package org.neuedu.chapter03_0611;

public class CycleDemo11 {
    public static void main(String[] args) {
        /*
               *
               ***
               *****
               *******
         */
        for (int i = 1; i <= 5; i++) {
            for (int j = 0; j < 2*i-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        /*
                 *        5   -   1   = 4
                ***       5   -   2   = 3
               *****      5   -   3   = 2
              *******     5   -   4   = 1
             *********    5   -   5   = 0
         */
        for (int i = 1; i <= 10; i++) {
            for (int j = 0; j < 10 - i; j++) {
                System.out.print(" ");
            }
            for (int j = 0; j < 2*i-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
